{% extends ext_tpl %}
{% url wizard.mydebts status as the_url %}
{% block style %}
	<link href="/css/report.css" rel="stylesheet" type="text/css" />
	{{ block.super }}
{% endblock %}

{% block header %}
<h1>Список долгов</h1>
{% if byte %}
<h4>Фильтр: наименование начинается с буквы &lsquo;{{byte}}&rsquo; </h4>
{% endif %}
{% endblock %}

{% block text %}
{% load pagination_tags %}
<form action="." method="post">
<div class="report">
{% if debts %}
	<div class="ind">
		<div class="clirep">
				<table class="details">
					<tr class="head">
						<th class="check">&nbsp;</th>
						<th><a href = "{{ the_url }}?sort=date">Долг</a></th>
						<th class="inn"><a href = "{{ the_url }}?sort=debtor">Должник</a></th>
						<th class="city"><a href = "{{ the_url }}?sort=creditor">Кредитор</a></th>
						<th class="city"><a href = "{{ the_url }}?sort=summa">Сумма</a></th>
					</tr>
				{% autopaginate debts 20 %}
					{% for debt in debts %}
					<tr>
						<td class="check"><input type="checkbox" class="action-select" value="{{debt.id}}" name="_selected_action" /></td>
						<td class="dolg"><a href = "/debt/{{debt.id}}/?next=/mydebts/">Долг от {{debt.date|date:"d.m.Y"}}</a></td>
						<td><a href = "/contragent/{% if debt.debtor.firm %}firm{% else %}individual{% endif %}/{{debt.debtor.id}}/">{{debt.debtor}}</a></td>
						<td><a href = "/contragent/{% if debt.creditor.firm %}firm{% else %}individual{% endif %}/{{debt.creditor.id}}/">{{debt.creditor}}</a></td>
						<td class="inn">{{debt.summa}}</td>
					</tr>
					{% endfor %}
				</table>
				{% paginate %}
				 <button type="submit" class="button" title="Выполнить выбранное действие" name="index" value="1"><span>Добавить</span></button>
				 <button type="submit" class="button" title="Выполнить выбранное действие" name="index" value="0"><span>Удалить</span></button>
		</div>
	</div>
{% endif %}
</div>
</form>
{% endblock %}

{% block left_center %}
{% include "alf.tpl" %}
{{block.super}}
{% endblock %}

